package com.huluobo.a2111douyindemo.adapter;

import android.widget.ImageView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.huluobo.a2111douyindemo.R;
import com.huluobo.a2111douyindemo.utils.ImageLoader;
import com.huluobo.mvvm_base.mvvm.bean.CommentBeanResult;

import java.sql.RowId;
import java.util.List;

/**
 * Created by LC on 2024/3/1.
 */
public class CommentAdapter extends BaseQuickAdapter<CommentBeanResult.CommentBean, BaseViewHolder> {
    public CommentAdapter(@Nullable List<CommentBeanResult.CommentBean> data) {
        super(R.layout.item_comment, data);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder baseViewHolder, CommentBeanResult.CommentBean commentBean) {
        //评论头像
        ImageLoader.getInstance().loadCircleImage(getContext(), commentBean.getIcon(),
                baseViewHolder.getView(R.id.item_comment_icon));
        //评论用户名
        baseViewHolder.setText(R.id.item_comment_name, commentBean.getUsername());
        //评论内容
        baseViewHolder.setText(R.id.item_comment_msg, commentBean.getMsg());
        //评论时间
        baseViewHolder.setText(R.id.item_comment_time, commentBean.getCreatetime());
    }
}
